package guda.house.biz.form;

import guda.house.dal.dataobject.RoleDO;
import javax.validation.constraints.NotNull;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


public class RoleForm {

    @NotNull(message = "不能为空")
    @Size(min=1,max=16,message = "长度在0到16个字符之间")
    @Pattern(regexp = "^[A-Za-z0-9_]*$" ,message = "只能是字母下划线")
    private String roleName;
    @Size(min=0,max=60,message = "长度在0到60个字符之间")
    private String roleDesc;

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleDesc() {
        return roleDesc;
    }

    public void setRoleDesc(String roleDesc) {
        this.roleDesc = roleDesc;
    }

    public RoleDO toDO() {
        RoleDO roleDO = new RoleDO();
        roleDO.setRoleDesc(roleDesc);
        roleDO.setRoleName(roleName);
        return roleDO;
    }

}
